package com.example.demo.entity;

import java.util.Calendar;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 *  IndustrialEconomicIndicators 实体类
 *
 * @author hx
 * @date 2022-11-23 16:18:33
 *
 */

@Data
public class IndustrialEconomicIndicators {
    /**
    * 序号
    *
    */

    private Long id;
    /**
    * 指标
    *
    */

    private String indicators;
    /**
    * 当月
    *
    */

    private Double thisMonth;
    /**
    * 当月止累计
    *
    */

    private Double accumulate;
    /**
    * 同比
    *
    */

    private Double monthOnMonth;
    /**
    * 日期
    *
    */
    @JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")

    private Date statisticalTime;



    /**
     * @return year 年份
     */
    public int getYear(){
        Calendar calender = Calendar.getInstance();
        calender.setTime(this.statisticalTime);
        int year = calender.get(Calendar.YEAR);
        return year;
    }


    /**
     * @return month 月份
     */
    public int getMonth(){
        Calendar calender = Calendar.getInstance();
        calender.setTime(this.statisticalTime);
        int month = calender.get(Calendar.MONTH) + 1;
        return month;
    }


}
